<?php
Class ActorRol extends Applicationbase{
	private $tabla="wc_actorrol";
	private	$tablaAR="wc_ActorRol AR ";
	private $tablaR="wc_Rol R ";
	
	function __construct(){
		$this->tabla="wc_actorrol";
	}
	function ListadoActorRol(){
		$a=$this->leeRegistro($this->tabla,"","","Estado desc","");
		return $a;
	}
	
	function EstadoActorRol($idActorRol){
		$exito=$this->cambiaEstado($this->tabla,"Id=".$idActorRol);
		return $exito;		
	}
	function grabaActorRol($data){
		$exito=$this->grabaRegistro($this->tabla,$data);
		return $exito;
	}
	function buscar($id){
		$actorrol=$this->leeRegistro($this->tabla,"","Id=".$id,"","");
		return $actorrol;
	}
	function actualizaActorRol($data,$filtro){
		$exito=$this->actualizaRegistro($this->tabla,$data,$filtro);
		return $exito;
	}
	

	function RolesxId($idActor){
		$data=$this->leeRegistro($this->tablaAR.",".$this->tablaR,
						"R.Nombre,R.Id","AR.IdActor =".$idActor." and AR.IdRol=R.Id ","","");
		return $data;
	}
	
	function verificaPostulante($idActor){
		$data=$this->leeRegistro($this->tabla,"Id","IdActor=".$idActor." and idRol=7","","");
		if($data!=Null){
			return true;
		}
		else{
			return false;
		}
	}
}
?>